﻿-- Ajout de la page AddResourceWindow.aspx
IF NOT EXISTS( SELECT NULL  FROM medianamik_Node where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7')  BEGIN  INSERT INTO [dbo].[medianamik_Node]             ([NodeId]             ,[ParentNodeId]             ,[ContentNodeId]             ,[TypeId]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[Flags]             ,[IsDeleted]             ,[Path]             ,[Depth]             ,[Position]             ,[Roles])       VALUES             ('CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0'             ,NULL             ,'3DAD4D08-B9BC-4603-A8DE-42A88A354B5B'             ,'2009-03-26 08:39:22.637'             ,'sa'             ,'2009-03-26 08:39:22.637'             ,'sa'             ,         0             ,         0             ,'.7A6A4803-1D66-40F5-8DAB-76AFDAE93CF0.CA43BF24-0617-4041-9BE9-D029729FCCD7.'             ,         1             ,         0             ,'')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND CultureNAme = 'fr-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[CultureName])       VALUES             ('E7B7DBC7-1C78-43BE-8CFE-09105B0B6C03'             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,         1             ,'2009-03-26 08:39:22.637'             ,'sa'             ,'2009-03-26 08:39:22.637'             ,'sa'             ,'fr-CA')  END
IF NOT EXISTS(SELECT NULL FROM Medianamik_NodeInstance WHERE NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND CultureNAme = 'en-CA')  BEGIN  INSERT INTO [dbo].[medianamik_NodeInstance]             ([NodeInstanceId]             ,[NodeId]             ,[IsActive]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             ,[CultureName])       VALUES             ('E2402522-6F47-4D90-BE71-33F661BC6FD3'             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,         1             ,'2009-03-26 08:39:22.637'             ,'sa'             ,'2009-03-26 08:39:22.637'             ,'sa'             ,'en-CA')  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND PropertyId = '60C0AA24-C355-4722-ACAA-21D363351479' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodePropertyValueId]             ,[NodeId]             ,[PropertyId]             ,[Value]             ,[IsApproved]             ,[IsDeleted]             ,[Revision]             ,[CultureName]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             )       VALUES             (NEWID()             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'60C0AA24-C355-4722-ACAA-21D363351479'             ,NULL             ,         0             ,         0             ,null             ,''             ,'2009-03-26 08:39:22.653'             ,'sa'             ,'2009-03-26 08:39:22.653'             ,'sa'             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND PropertyId = '29571C7C-3B7A-4576-8BB0-F2EAF8413D20' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodePropertyValueId]             ,[NodeId]             ,[PropertyId]             ,[Value]             ,[IsApproved]             ,[IsDeleted]             ,[Revision]             ,[CultureName]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             )       VALUES             (NEWID()             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'29571C7C-3B7A-4576-8BB0-F2EAF8413D20'             ,'False'             ,         0             ,         0             ,null             ,''             ,'2009-03-26 08:39:22.653'             ,'sa'             ,'2009-03-26 08:39:22.653'             ,'sa'             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND PropertyId = 'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodePropertyValueId]             ,[NodeId]             ,[PropertyId]             ,[Value]             ,[IsApproved]             ,[IsDeleted]             ,[Revision]             ,[CultureName]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             )       VALUES             (NEWID()             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'A9D96D60-4E0D-4EF6-831C-AAD02A1D2BCF'             ,'False'             ,         0             ,         0             ,null             ,''             ,'2009-03-26 08:39:22.653'             ,'sa'             ,'2009-03-26 08:39:22.653'             ,'sa'             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND PropertyId = '7213C44C-BBC7-4095-AE52-0DE37E7276C7' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodePropertyValueId]             ,[NodeId]             ,[PropertyId]             ,[Value]             ,[IsApproved]             ,[IsDeleted]             ,[Revision]             ,[CultureName]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             )       VALUES             (NEWID()             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'7213C44C-BBC7-4095-AE52-0DE37E7276C7'             ,'False'             ,         0             ,         0             ,null             ,''             ,'2009-03-26 08:39:22.653'             ,'sa'             ,'2009-03-26 08:39:22.653'             ,'sa'             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND PropertyId = 'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodePropertyValueId]             ,[NodeId]             ,[PropertyId]             ,[Value]             ,[IsApproved]             ,[IsDeleted]             ,[Revision]             ,[CultureName]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             )       VALUES             (NEWID()             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'A5F1D87F-3086-4CEA-A983-A09D4FE9FC4C'             ,NULL             ,         0             ,         0             ,null             ,''             ,'2009-03-26 08:39:22.653'             ,'sa'             ,'2009-03-26 08:39:22.653'             ,'sa'             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND PropertyId = '47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9' AND CultureName = '' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodePropertyValueId]             ,[NodeId]             ,[PropertyId]             ,[Value]             ,[IsApproved]             ,[IsDeleted]             ,[Revision]             ,[CultureName]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             )       VALUES             (NEWID()             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'47096ACE-4C51-4C8F-BAE2-15A6FD90F6E9'             ,'/ModalWindows/AddResourceWindow.aspx'             ,         0             ,         0             ,null             ,''             ,'2009-03-26 08:39:22.653'             ,'sa'             ,'2009-03-26 08:39:22.653'             ,'sa'             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'en-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodePropertyValueId]             ,[NodeId]             ,[PropertyId]             ,[Value]             ,[IsApproved]             ,[IsDeleted]             ,[Revision]             ,[CultureName]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             )       VALUES             (NEWID()             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Add resource'             ,         0             ,         0             ,null             ,'en-CA'             ,'2009-03-26 08:39:22.653'             ,'sa'             ,'2009-03-26 08:39:22.653'             ,'sa'             )  END
IF NOT EXISTS( SELECT NULL FROM medianamik_NodePropertyValue where NodeId = 'CA43BF24-0617-4041-9BE9-D029729FCCD7' AND PropertyId = '18232ABC-5DD8-4AE5-947A-16F3AF3A8715' AND CultureName = 'fr-CA' AND Revision IS NULL)  BEGIN  INSERT INTO [dbo].[medianamik_NodePropertyValue]             ([NodePropertyValueId]             ,[NodeId]             ,[PropertyId]             ,[Value]             ,[IsApproved]             ,[IsDeleted]             ,[Revision]             ,[CultureName]             ,[CreatedOn]             ,[CreatedBy]             ,[ModifiedOn]             ,[ModifiedBy]             )       VALUES             (NEWID()             ,'CA43BF24-0617-4041-9BE9-D029729FCCD7'             ,'18232ABC-5DD8-4AE5-947A-16F3AF3A8715'             ,'Ajout d''une ressource'             ,         0             ,         0             ,null             ,'fr-CA'             ,'2009-03-26 08:39:22.653'             ,'sa'             ,'2009-03-26 08:39:22.653'             ,'sa'             )  END

-- Création de la vue LocalizationsNoTrans
IF NOT EXISTS (SELECT * FROM SYS.VIEWS WHERE name = 'LocalizationsNoTrans' AND schema_id = SCHEMA_ID('dbo'))
BEGIN
	EXEC('CREATE VIEW LocalizationsNoTrans
	AS
	SELECT     pk, ResourceId, Value, LocaleId, ResourceSet, Type, BinFile, TextFile, Filename
	FROM       Localizations
	WHERE     (ResourceId NOT IN
							  (SELECT     ResourceId
								FROM          Localizations AS loc
								WHERE      (LocaleId <> '''')))')
END



--Ajout de clés de traduction
Declare @confirmResourceId nvarchar(max)
declare @buttonResourceId nvarchar(max)
Declare @confirmTextFr nvarchar(max)
Declare @confirmTextEn nvarchar(max)
Declare @buttonTextFr nvarchar(max)
Declare @buttonTextEn nvarchar(max)

select @confirmResourceId = 'RegenViewsConfirmText'
select @buttonResourceId = 'RegenViewsButtonText'
Select @confirmTextFr = 'Etes vous sur de vouloir regénérer les vues ?'
select @confirmTextEn = 'Are you sure you want to regenerate views ?'
select @buttonTextFr = 'Regénérer les vues'
select @buttonTextEn = 'Regenerate views'
--------
